import {Map} from 'immutable';
import * as actionTypes from './constants';

const defaultState = Map({
    topList:[],
    currentIndex:0,
})

export default (state=defaultState,action)=>{
    switch(action.type){
        case actionTypes.CHANGE_TOP_LIST:
            return state.set("topList",action.topList);
        case actionTypes.CHANGE_CURRENT_INDEX:
            return state.set("currentIndex",action.currentIndex);
        default:
            return state;
    }
}
